package toutiao.t1;

import java.util.Scanner;
import java.util.Stack;

public class Main {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        String path = scanner.next();

        String[] paths = path.split("/");

        Stack<String> stack = new Stack<>();
        for(int i=0;i<paths.length;i++){
            if("".equals(paths[i]) || ".".equals(paths[i]))
                continue;
            if("..".equals(paths[i])){
                if(!stack.isEmpty())
                    stack.pop();
            }else{
                stack.push(paths[i]);
            }
        }

        StringBuilder sb = new StringBuilder("/");
        stack.forEach(str->{
            sb.append(str).append("/");
        });
        String res = sb.toString();
        int len = res.length();
        if(len == 1){
            System.out.println(res);
        }else {
            System.out.println(res.substring(0, len - 1));
        }

    }

}
